package model;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This class is responsible for parsing the Email objects.
 * 
 * This class contains a static method to parse the email object
 * provided and return the meeting object. When the meeting is created,
 * all the attendees receive and email notification. This class parse the
 * email notification and create the meeting object for the attendee. 
 * @author Sukhjinder K. Narula
 * @since June, 2013
 */
 public class ParseEmail 
{
	/**
	 * This method parse the email object provided and create the meeting object from it.
	 * @param email: email object to be parsed
	 * @return meeting: return the meeting object 
	 */
	
	public static void searchForEmails(Email email)
	{
		String textToParse = email.getBody();
		Pattern pattern = Pattern.compile("(.*)Start time: (.*\\n)");
		Matcher matcher = pattern.matcher(textToParse);

		
		if (matcher.find()){
			System.out.println(matcher.group(2));
		}
	
	}
		
}
